package io;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;

public class RandomWriteFile {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		File file = new File(CreateFile.filename);
		try {
			RandomAccessFile demo=new RandomAccessFile(file,"rw");
	        demo.writeBytes("hello");
	        demo.writeInt(12);
	        demo.writeBoolean(true);
	        demo.writeChar('A');
	        demo.writeFloat(1.21f);
	        demo.writeDouble(12.123);
	        demo.close(); 
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
